import * as obj  from '@/api/upload'
const upload ={
	state:{
		upload_Token:''
	},
	mutations:{
		SET_UPLOAD_TOKEN:(state,token)=>{
			state.upload_Token = token
		}
	},
	actions:{
		uploadToken({commit}){
			return new Promise((resolve, reject) => {
				obj.uploadToken().then(response => {	
					commit('SET_UPLOAD_TOKEN', response.uptoken)
					resolve()
				}).catch(error => {
					reject(error)
				})
			})
		}
	}
}
export default upload